<?php echo $this->Html->css(array(HOST.'/actions',HOST.'/offers.index','form'),null,array('inline'=>false));?>


<body>
<?php echo $this->Section->main(); ?>

	<div class="container container_3">		
		<div class='grid_1'>
			<?php echo $this->Html->link($this->Html->image(HOST.'/logo.png'),'/',array('escape'=>false,'title'=>__('LEX Nieruchomości - aktualna oferta',true)))?>
			<?php echo $this->element('menu-left')?>
		</div>		
		<div class='grid_2'>
			<?php echo $this->element('menu-category')?>
			<div class='clear'>&nbsp;</div>
			

			<div class="container container_offers_3">
				<div class="offers_grid_3">
					
					<div class="opis-oferty-nad-galeria">
						<table><tr>
							<td align="left">
								<?php echo 'Numer oferty biura LEX: '.$offer['Offer']['numer'].''; ?>
							</td>
							<td align="center"> 
								<?php echo 'Adres: '.$offer['Offer']['miasto'].', '.$offer['Offer']['ulica']; ?>
							</td>
							<td align="right">
								<?php echo 'Powierzchnia: '.$offer['Offer']['powierzchnia_od'].'m<sup>2</sup>'; ?>
							</td>
						</tr></table>
					</div>
					<?php echo $this->element('offer-gallery',array('gallery'=>$offer['Image']))?>	
					<div class='clear'>&nbsp;</div>
				</div>
			</div>
			
			<div class='clear'>&nbsp;</div>
			
			<div class="container container_category_4 black">
				<div class="category_grid_4">
					<?php 
						if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){ 
						echo $this->Form->create('Offer',array('url'=>array('controller'=>'offers','action'=>'edit')));
					?>
					<table><tr><td style="padding: 10px 10px;">
					<?php 	
						echo $this->Form->input('id',array('value'=>$offer['Offer']['id']));
						echo $this->Form->radio('promocja',array(1=>__('Promocje',true),2=>__('Baner',true),3=>__('Promocje & Baner',true),''=>__('Brak',true)),array('legend'=>false,'value'=>$offer['Offer']['promocja']));
					?>
					</td>
					<td style="padding: 10px 10px;">
						<?php echo $this->Form->submit(__('Zmień',true));?>
					</td></tr></table>
					
					<?php	
						echo $this->Form->end();
						}
					?>				
				</div>
				<div class='clear'>&nbsp;</div>
				
				<div class="category_grid_2">
					<div class="content">
						<?php echo 'Numer oferty biura LEX: <h2>'.$offer['Offer']['numer'].'</h2>'; ?>
					</div>
				</div>
				<div class="category_grid_2">
					<div class="content">
					<?php echo 'Cena: <h2>'.$this->Number->currency($offer['Offer']['cena_od'],'',array('after'=>'zł','thousands'=> ' ','places'=>0)).'</h2>'; ?>
					</div>
				</div>	

				<div class="category_grid_2">
					<div class="content">
					<?php echo 'Miasto: <h2>'.$offer['Offer']['miasto'].'</h2>'; ?>
					</div>
				</div>
				<div class="category_grid_2">
					<div class="content">
					<?php echo 'Powierzchnia: <h2>'.$offer['Offer']['powierzchnia_od'].'m<sup>2</sup></h2>'; ?>
					</div>
				</div>
												
				<?php 
					if(isset($columns) && is_array($columns)){
					foreach ($columns as $name => $row) {
					if($row['onoff'] && isset($offer['Offer'][$name]) && !empty($offer['Offer'][$name])){
				?>				
				<div class="category_grid_2">
					<div class="content">
					<?php echo $row['name'].': '.$offer['Offer'][$name]; ?>
					</div>
				</div>	
				<?php }}}?>		

				<div class='clear'>&nbsp;</div>
			</div>
			
			<div class='clear'>&nbsp;</div>
			
			<div class="container container_offers_3">
				<div class="offers_grid_3">
						
					<div class="content">

							<?php echo nl2br($offer['Offer']['opis_publiczny']); ?>				
					
					</div>
				</div>
			</div>
			
			
			<div class="container container_offers_3">
				<div class="offers_grid_3">
					<div class="content">
						<h2><?php echo __('Podobne oferty')?></h2>
						<?php echo $this->element('offer_icon_home')?>				
					
					</div>
				</div>
			</div>
						
		</div>
		<div class='clear'>&nbsp;</div>
		<?php echo $this->element('footer')?>
	</div>
	<div class='clear'>&nbsp;</div>
</body>




<?php if($session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'admin' || $session->check('Auth.User.id') && $this->Session->read('Auth.User.group') == 'manag'){?>
<?php echo $this->Html->script(array(HOST.'/actions'),$options = array('allowCache'=>false,'safe'=>false,'inline'=>false));?>		
<div class="actions main_actions">
	<h3><?php __('Actions'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Edytuj ofertę', true), array('action' => 'edit', $offer['Offer']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Usuń ofertę', true), array('action' => 'delete', $offer['Offer']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $offer['Offer']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Lista ofert', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Dodaj ofertę', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Opcje wyswietlanai', true), array('controller' => 'offers_columns','action' => 'index'));?></li>
		<li><?php echo $this->Html->link(__('Słownik typów', true), array('controller' => 'typs', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Słownik transakcji', true), array('controller' => 'transakcjas', 'action' => 'index')); ?> </li>
		<li><?php //echo $this->Html->link(__('Dodaj zdjęcie', true), array('controller' => 'images', 'action' => 'add')); ?> </li>
		
	</ul>
</div>
<?php }?>
